<?php
class ShoppingbagController extends Zend_Controller_Action {

	protected $bag;
	
	public function init() {
		$this->bag = new Macys_Api_V2_Shoppingbag();
	}

	public function indexAction() {
		// Bag
	}

	public function v2retrivebycookieAction() {
		$this->view->shoppingbag = $this->bag->retriveBag();
	}
	
	public function v2retrivebybagidAction() {
		// If we get from Customer form use it or use 
		// the one we already have bag id
	}
	
	public function additemAction() {
		$request = $this->getRequest();
		$this->bag->processInputParams($request->getParams()) ;
		$this->view->addbag = $this->bag->addItem();
		//$this->getHelper('viewRenderer')->setNoRender();
	}

	public function deleteitemAction() {
		$request = $this->getRequest();
		$this->bag->processInputParams($request->getParams()) ;
		//$this->view->deletedStatus = $this->bag->deleteItem();
		print_r($this->bag->deleteItem());
		$this->getHelper('viewRenderer')->setNoRender();
	}
	
	public function deletebybagidAction() {
		$this->getHelper('viewRenderer')->setNoRender();
	}

	public function updateitemAction() {
		$request = $this->getRequest();
		$this->bag->processInputParams($request->getParams()) ;
		$this->view->updatedbag = $this->bag->updateItem();
	}

	public function mergeAction() {

	}

	public function retriveAction() {

	}

}